package by.amakarevich.datamodel;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.MapsId;
import javax.persistence.OneToOne;

@Entity
public class Yarn implements Serializable {
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long id;
	
	@Column
	private String season;
	
	@Column
	private Long length;
	
	@Column
	private Long weight;
	
	@Column
	private Boolean cotton;
	
	@Column
	private Boolean wool;
	
	@Column
	private Boolean acrylic;
	
	@Column
	private Boolean flax;
	
	@Column
	private Boolean mohair;
	
	@Column
	private Boolean viscose;
	
	@MapsId
	@OneToOne(fetch = FetchType.LAZY, cascade = { CascadeType.PERSIST, CascadeType.MERGE })
	@JoinColumn(updatable = false, name = "product_id")
	private Product product;
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getSeason() {
		return season;
	}
	public void setSeason(String season) {
		this.season = season;
	}
	public Long getLength() {
		return length;
	}
	public void setLength(Long length) {
		this.length = length;
	}
	public Long getWeight() {
		return weight;
	}
	public void setWeight(Long weight) {
		this.weight = weight;
	}
	public Boolean getCotton() {
		return cotton;
	}
	public void setCotton(Boolean cotton) {
		this.cotton = cotton;
	}
	public Boolean getWool() {
		return wool;
	}
	public void setWool(Boolean wool) {
		this.wool = wool;
	}
	public Boolean getAcrylic() {
		return acrylic;
	}
	public void setAcrylic(Boolean acrylic) {
		this.acrylic = acrylic;
	}
	public Boolean getFlax() {
		return flax;
	}
	public void setFlax(Boolean flax) {
		this.flax = flax;
	}
	public Boolean getMohair() {
		return mohair;
	}
	public void setMohair(Boolean mohair) {
		this.mohair = mohair;
	}
	public Boolean getViscose() {
		return viscose;
	}
	public void setViscose(Boolean viscose) {
		this.viscose = viscose;
	}
	public Product getProduct() {
		return product;
	}
	public void setProduct(Product product) {
		this.product = product;
	}
	
	
}
